package me.samlss.lighter.shape;


import ohos.agp.render.Path;
import ohos.agp.utils.RectFloat;

/**
 * @author: zhu_zhonglin
 * @time: 2021/4/25
 */
public class OvalShape extends LighterShape {

    /**
     * Construct a circle shape object.
     *
     * Will call {@link #OvalShape(float)} and pass the parameter is (15);
     * */
    public OvalShape() {
        super(15);
    }

    /**
     * Construct a oval shape object.
     *
     * @param blurRadius
     * */
    public OvalShape(float blurRadius){
        super(blurRadius);
    }

    @Override
    public void setViewRect(RectFloat rect) {
        super.setViewRect(rect);

        if (!isViewRectEmpty()) {
            path.reset();
            path.addOval(rect, Path.Direction.CLOCK_WISE);
        }
    }
}
